package actions.manager;

import java.util.Calendar;

import veilingService.ServiceProvider;

import com.opensymphony.xwork2.ActionSupport;

public class InkomstenOverzicht extends ActionSupport {

	String[] months = { "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG",
			"SEP", "OCT", "NOV", "DEC" };
	String[] monthsp = {"January", "February",
			  "March", "April", "May", "June", "July",
			  "August", "September", "October", "November",
			  "December"};
	

	String[] i, o, p;


	String m,n,b;
	
	public String execute() {
		Calendar c = Calendar.getInstance();
		int month = c.get(Calendar.MONTH);
		i = ServiceProvider.getBiedingService().getInkomstenOverzicht(months[month]);
		m = months[month];
		if (month - 1 == -1) {
			month = 11;
		} else {
			month--;
		}
		o = ServiceProvider.getBiedingService().getInkomstenOverzicht(months[month]);
		n = months[month];
		if (month - 1 == -1) {
			month = 11;
		} else {
			month--;
		}
		p = ServiceProvider.getBiedingService().getInkomstenOverzicht(months[month]);
		b = months[month];
		
		
		System.out.println("Maand: "+ m+b+n);
		month = c.get(Calendar.MONTH);
		m = monthsp[month];
		if (month - 1 == -1) {
			month = 11;
		} else {
			month--;
		}
		n = monthsp[month];
		if (month - 1 == -1) {
			month = 11;
		} else {
			month--;
		}
		b = monthsp[month];
		return ActionSupport.SUCCESS;
	}
	
	
	public String[] getI() {
		return i;
	}


	public void setI(String[] i) {
		this.i = i;
	}


	public String[] getO() {
		return o;
	}


	public void setO(String[] o) {
		this.o = o;
	}


	public String[] getP() {
		return p;
	}


	public void setP(String[] p) {
		this.p = p;
	}


	public String getM() {
		return m;
	}

	public void setM(String m) {
		this.m = m;
	}

	public String getN() {
		return n;
	}

	public void setN(String n) {
		this.n = n;
	}

	public String getB() {
		return b;
	}

	public void setB(String b) {
		this.b = b;
	}
}
